import amesu from "../../model/bot/amesu";
import browser, { tempDir } from "../../model/browser/browser";
import { MsgAction, Tpl_rankInfo } from "../../shared/master/MsgAction";

export default function(data:MsgAction){
    let d = data.data as Tpl_rankInfo;
    let obj:any = {};
    for (let i = 0; i < d.list.length; i++) {
        const element = d.list[i];
        obj[`no_${i + 1}`] = element;
    }
    obj.query_rank = d.query_rank
    obj.query_name = d.query_name
    obj.title = d.rank_name
    obj.start = ''
    browser.render(tempDir.等级模板, obj).then((png) => {
        amesu.sendLocaImage(data.tolocation, png);
    });
}